﻿// <copyright file="SimulationCollection.cs" company="City of Portland, BES-ASM">
// </copyright>
// <summary>SimulationCollection class</summary>

namespace BESASM.EMGAATS.BusinessClasses
{
  using System;
  using System.Collections.Generic;
  using System.Collections.ObjectModel;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;

  /// <summary>
  /// A collection of simulations, keyed by simulation name
  /// </summary>
  public class SimulationCollection : KeyedCollection<string, ISimulation>
  {
    /// <summary>
    /// Initializes a new instance of the <see cref="SimulationCollection" /> class.
    /// key is case insensitive
    /// </summary>
    public SimulationCollection() : base(StringComparer.OrdinalIgnoreCase) 
    {
    }
    
    /// <summary>
    /// Gets the key for a given ISimulation
    /// </summary>
    /// <param name="item">The ISimulation in question</param>
    /// <returns>The name of the simulation</returns>
    protected override string GetKeyForItem(ISimulation item)
    {
      return item.SimulationName;
    }
  }
}
